package com.safe.first.application.dto.cmd;

import com.safe.first.domain.order.constants.OrderType;
import com.safe.first.domain.order.factory.CompositeOrderFactory;
import lombok.Data;

/**
 * @author Mickey
 * @since 2022/5/27
 **/
@Data
public class CreateOrderCmd<T> {

    private OrderType orderType;

    private T data;

    public CompositeOrderFactory.CompositeOrderParam<T> converter() {
        CompositeOrderFactory.CompositeOrderParam<T> objectCompositeOrderParam = new CompositeOrderFactory.CompositeOrderParam<>();
        objectCompositeOrderParam.setOrderType(this.orderType);
        objectCompositeOrderParam.setData(this.data);
        return objectCompositeOrderParam;
    }
}
